<?php

namespace App\Admin\Forms\Aliyun;

use AlibabaCloud\Client\Exception\ClientException;
use AlibabaCloud\Client\Exception\ServerException;
use App\Enums\BucketType;
use App\Enums\DomainType;
use Dcat\Admin\Exception\RuntimeException;
use Dcat\Admin\Http\JsonResponse;
use Dcat\Admin\Traits\LazyWidget;

class RankDomainForm extends DcdnForm
{
    use LazyWidget;

    /**
     * @throws ClientException
     * @throws ServerException
     */
    public function handle(array $input): JsonResponse
    {
        return $this->baseHandle($input, DomainType::RANK);
    }

    /**
     * @throws RuntimeException
     */
    public function form(): void
    {
        $this->baseForm(BucketType::RANK);
    }
}
